<!--
* description: 超时未跟进线索
* author: mwh
* createdDate: 2010-11-21
-->
<template>
  <div class="app-container app-container-table">
    <one-table-template
      ref="multipleTable"
      :key="oneTableKey"
      :dynamicButtons="tableButtons"
      :dynamicComponents="tableComponents"
      :dynamicApiConfig="apiConfig"
      :dynamicTableCols="tableCols"
      :dynamicFormFields="formField"
      :dynamicIsShowSelect="false"
      :dynamicIsInitTable="false"
      :dynamicIsColumnDrop="false"
      :isSetDefaultBrand="false"
    />
    <edit
      :dynamicEditRowData="editRowData"
      :popupsVisible="editPopupsVisible"
      :key="editPopupsKey"
      :popupsState="editPopupsState"
      @close="close"
    ></edit>
  </div>
</template>
<script>
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import { crmApis } from "@/api/apiList/crm.js";
import OneTableTemplate from "@/components/templates/oneTable";
import Vue from "vue";

export default {
  name: "customerInformation",
  // 组件混入对象
  mixins: [oneTableWithViewTemplateMixins],
  components: {
    OneTableTemplate,
    Edit: () => import("./timeOutClueEdit"),
  },
  data() {
    return {
      // 网格查询API配置对象
      apiConfig: crmApis.dfpvVeBigCustomerMaterialQueryListForPage,
      // 动态组件-按钮
      tableButtons: [
        {
          compKey: "btnKey1",
          type: "primary",
          size: "small",
          clickEvent: () => this.queryTable(1),
          text: this.$t("sys.button.query"),
          name: "search",
          position: "right",
        }, // 查询
        {
          compKey: "btnKey2",
          type: "",
          size: "small",
          clickEvent: () => this.reset(),
          text: this.$t("sys.button.reset"),
          name: "reset",
          position: "right",
        }, // 重置
        {
          compKey: "btnKey3",
          type: "",
          size: "small",
          clickEvent: () => this.exportExcel(),
          text: this.$t("sys.button.export"),
          name: "export",
          position: "left",
        }, // 导出
      ],
      // 动态组件-查询条件
      tableComponents: [
        {
          compKey: "compKey1",
          labelName:"客户名称", //客户名称
          codeField: "dlrId",
          // textField: "dlrCode",
          component: () => import("@/components/org/orgDlr"),
          type: "propus",
          isMul: true,
          isMust: true,
        },
        {
          compKey: "compKey6",
          labelName: "电话", //电话
          codeField: "dlrCode",
          // textField: "dlrCode",
          component: () => import("@/components/org/commonInput"),
          type: "propus",
          // isMul: true,
          isMust: true,
        },
        {
          compKey: "compKey2",
          labelName:"当前处理人", // 当前处理人
          codeField: "custName",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true,
        },
        // {
        //   compKey: "compKey3",
        //   labelName: "档案编号", // 档案编号
        //   codeField: "custNumber",
        //   component: () => import("@/components/org/commonInput"),
        //   type: "inputText",
        //   isMust: true,
        // },
        // {
        //   compKey: "compKey4",
        //   labelName: this.$t("ve.label.bigarea"), // 大区
        //   codeField: "bigAreaId",
        //   // textField: "smallAreaName",
        //   component: () => import("@/components/org/BigArea"),
        //   type: "propus",
        //   isMust: false,
        // },
        // {
        //   compKey: "compKey5",
        //   labelName: this.$t("org.label.smallAreaName"), // 小区
        //   codeField: "smallAreaId",
        //   parentFileds: "value:bigAreaId-bigAreaId",
        //   component: () => import("@/components/org/SmallArea/index.vue"),
        //   type: "propus",
        //   isMust: false,
        // },
      ],
      // 动态生成网格列
      tableCols: [
        {
          prop: "custName",
          label: "操作",
          codeField: "custName",
          width: 120,
          align: "center",
          isComponent: true,
          comps: [
            {
              compKey: "propKey0",
              labelName: this.$t("ve.label.largeCustomerName"),
              codeField: "custName",
              clickEvent: this.edit,
              component: () => import("@/components/org/linkButton"),
            },
          ],
        },
        {
          prop: "custName",
          label: "客户名称",
          width: 100,
          align: "center",
          fixed: true,
        },
        {
          prop: "contactTel",
          label: "电话",
          width: 120,
          align: "center",
          fixed: true,
        },

        {
          prop: "serverOrder",
          label: "线索单号",
          width: 200,
          align: "center",
        },
        {
          prop: "statusName",
          label: "单据状态",
          width: 80,
          align: "center",
        },
        {
          prop: "crruNodeName",
          label: "作业状态",
          width: 80,
          align: "center",
        },
        {
          prop: "isFirstCallbackName",
          label: "首次回访",
          width: 80,
          align: "center",
        },
        {
          prop: "carBrandName",
          label: "意向品牌",
          width: 130,
          align: "center",
        },
        {
          prop: "carSeriesCn",
          label: "意向车系",
          width: 130,
          align: "center",
          // hidden:true
        },

        {
          prop: "clueLevelCode",
          label: "意向级别",
          width: 80,
          align: "center",
        },
        // {
        //   prop: "actionName",
        //   label: "活动名称",
        //   width: 100,
        //   align: "center"
        // },
        {
          prop: "cantactWayName",
          label: "线索渠道",
          width: 130,
          align: "center",
        },
        {
          prop: "infoChanMName",
          label: "一级信息来源",
          width: 130,
          align: "center",
        },
        {
          prop: "infoChanDName",
          label: "二级信息来源",
          width: 130,
          align: "center",
        },
        {
          prop: "createdDate",
          label: "建单时间",
          width: 150,
          align: "center",
          // hidden:true
        },
        {
          prop: "remainDataDate",
          label: "留资时间",
          width: 150,
          align: "center",
        },
        {
          prop: "nextCallbackDate",
          label: "下次回访时间",
          width: 150,
          align: "center",
        },
        {
          prop: "phoneForAttr",
          label: "号码归属地",
          width: 120,
          align: "center",
        },
        {
          prop: "processingAction",
          label: "",
          width: null,
          align: "center",
          hidden: true,
        },
      ],
      // 表单查询数据
      formField: {
        dlrId: "", //经销商Id（多选）
        dlrCode: "", //经销商编码（多选）
        custName: "", //大客户名称
        custNumber: "", //档案编号
        bigAreaId: "", //大区Id（多选）
        smallAreaId: "", //小区Id（多选）
      },
      // 是否使用刷新Key的方式刷新弹窗
      resetDialogKey: false,
    };
  },
};
</script>
